module.exports = {
    open: false,
    description: '会话状态已读',
    handler(req, res, next) {
        let doc = req.body;
        let conversationID = doc.conversationID;
        let userID = doc.userID;

        req.mongo.collection("conversation").updateMany(
            {"_id": conversationID, "lastMessageUserId": userID},
            {$set: {"readState": 1}},
            (e, r) => {
                if (e) return res.err.mongoError(e);
                return res.reply("未读状态修改为已读!")
            }
        )
    }
}